<div class="container">
    <div class="conditions">
      [@b.form name="search_example_form" action="!examples"]
        [#list Parameters?keys as k]
          [#if k != "_"]
          <input type="hidden" name="${k}" value="${Parameters[k]}"/>
          [/#if]
        [/#list]
      [/@]
      <div class="total">共检索到${examples.totalItems}条记录</div>
      <div class="panel-group" aria-multiselectable="true">
        <div class="panel panel-default">
          <div class="panel-heading" role="tab">
            <a role="button" class="panel-title" data-toggle="collapse" href="#exampleCollapseOne">时间<i class="pull-right fa fa-angle-down"></i></a>
          </div>
          <div id="exampleCollapseOne" class="panel-collapse collapse in" role="tabpanel">
            <div class="panel-body">
              <ul class="list-unstyled">
                [#list yearStats! as yearStat]
                <li class="condition">
                   <a href="javascript:void(0)" onclick="searchByDimentions(document.search_example_form,'begin=${yearStat[0]}&end=${yearStat[0]}')">
                    ${yearStat[0]}年<span>(${yearStat[1]})</span>
                   </a>
                   [#if (Parameters['begin']!"") == yearStat[0]?string]<a href="javascript:void(0)" onclick="searchByDimentions(document.search_example_form,'begin=&end=')" style='color:red'>X</a>[/#if]
                </li>
                [/#list]
                <li>
                  <form class="form-inline" name="search_example_by_year_form" action="${b.url('!examples')}" method="post">
                  [#if (Parameters['begin']!"")?length==0]
                    <div class="form-group">
                      <input type="text" class="form-control year" name="begin" value="">
                    </div>
                    <div class="form-group">
                      <span>-</span>
                    </div>
                    <div class="form-group">
                      <input type="text" class="form-control year" name="end" value="">
                    </div>
                    <button type="submit" class="btn btn-default" onclick="bg.form.submit(this.form)">确定</button>
                  [/#if]
                  </form>
                </li>
              </ul>
            </div>
          </div>
        </div>

         <div class="panel panel-default">
          <div class="panel-heading" role="tab">
            <a role="button" class="panel-title" data-toggle="collapse" href="#exampleCollapseTwo">区域<i class="pull-right fa fa-angle-down"></i></a>
          </div>
          <div id="exampleCollapseTwo" class="panel-collapse collapse in" role="tabpanel" aria-labelledby="headingTwo">
            <div class="panel-body">
              <ul class="list-unstyled">
                [#list divisionStats as divisionStat]
                <li>
                 <a href="javascript:void(0)" onclick="searchByDimentions(document.search_example_form,'division=${divisionStat[0]}')">
                   ${divisionStat[0]}<span>(${divisionStat[1]})</span>
                 </a>
                 [#if (Parameters['division']!"") == divisionStat[0]]<a href="javascript:void(0)" onclick="searchByDimentions(document.search_example_form,'division=')">X</a>[/#if]
                </li>
                [/#list]
              </ul>
            </div>
          </div>
        </div>
        
         <div class="panel panel-default">
          <div class="panel-heading" role="tab">
            <a role="button" class="panel-title" data-toggle="collapse" href="#exampleCollapseThree">项目类型<i class="pull-right fa fa-angle-down"></i></a>
          </div>
          <div id="exampleCollapseThree" class="panel-collapse collapse in" role="tabpanel" aria-labelledby="headingThree">
            <div class="panel-body">
              <ul class="list-unstyled">
              [#list projecttype2Stats as projecttype2Stat]
                <li>
                 <a href="javascript:void(0)" onclick="searchByDimentions(document.search_example_form,'projecttype=${projecttype2Stat[0]}')">
                   ${projecttype2Stat[0]}<span>(${projecttype2Stat[1]})</span>
                 </a>
                 [#if (Parameters['projecttype']!"") == projecttype2Stat[0]]<a href="javascript:void(0)" onclick="searchByDimentions(document.search_example_form,'projecttype=')">X</a>[/#if]
               
                </li>
                [/#list]
              </ul>
            </div>
          </div>
        </div>
       
      </div>
    </div>
    
    <div class="main">
          <div class="container-fluid">
            <div class="pagebar row">
              [@b.form action="!examples" name="search_in_result_exampleform"]
              <div class="col-xs-2 sort-control">
                <select class="form-control">
                  <option>默认排序</option>
               
                </select>
              </div>
              <div class="col-xs-2 field-filter">
                <input type="text" class="form-control" placeholder="项目名称" name="example.name" value="${Parameters['example.name']!}">
              </div>
              <div class="col-xs-2 field-filter">
                 <input type="text" class="form-control" placeholder="所在区域" name="example.division.name" value="${Parameters['example.division.name']!}">
              </div>
              <div class="col-xs-2 field-filter">
                 <input type="text" class="form-control" placeholder="项目类型" name="example.projecttype2.name" value="${Parameters['example.projecttype2.name']!}">
              </div>
              <div class="pull-right">
                <button type="submit" onclick ="bg.form.submit(this.form)" class="btn btn-default"><i class="fa fa-search"></i> 在结果中搜索</button>
              </div>
              [/@]
            </div>
          </div>
          <ol class="list-unstyled">
            [#list examples as example] 
            <li class="row">
              <h5>
                <span class="index-no"></span>
                <span class="label label-primary">阅读全文</span>
            [@b.a href="!exampleInfo?id="+example.id class="title"]${example.name!}[/@]
               
                <span>(被引用 1 次)</span>
              </h5>
              <div class="col-xs-10 col-md-11 info-content">
                <div class="author">
                   <a href="#">${example.year!}</a> / <a href="#">${example.division.name!}</a> / <a href="#">${example.projecttype2.name!}</a> / <a href="#">${example.budget.name!}</a> / 
                   <a href="#">${example.evaulationtype.name!}</a> /   <a href="#">${example.level.name!}</a> 
                   
                </div>
               
              </div>
              <div class="pull-right action-bar">
                <ul class="list-unstyled">
                  <li><a href="#" class="text-info"><i class="fa fa-download"></i>下载</a></li>
                   <li><a href="#" class="text-info"><i class="fa fa-file-text-o"></i>
      				[@b.a target="_blank" href="!viewExample?id=${example.id}"] 阅读[/@]
                  </a></li>
                </ul>
              </div>
             
            </li>
            [/#list]
          </ol>
             <div class="pagination-bar row">
            [#assign currentPageIndex=examples.pageIndex/]
            [#assign totalPageIndex=examples.totalPages/]
            <ul class="pagination">
              <li>[@b.a href="!examples?pageIndex=1"]首页[/@]</li>
              [#if currentPageIndex>1]
              <li>[@b.a href="!examples?pageIndex=" +(currentPageIndex-1)]上一页[/@]</li>
              [/#if]
              [#list currentPageIndex-3 .. currentPageIndex-1 as i]
              [#if i>0]
              <li>[@b.a href="!examples?pageIndex=" +(i)]${i}[/@]</li>
              [#else] [#break/]
              [/#if]
              [/#list]
              <li class="active"><a href="#">${currentPageIndex}</a></li>
              [#list currentPageIndex+1 .. currentPageIndex+3 as i]
              [#if i<=totalPageIndex]
              <li>[@b.a href="!examples?pageIndex=" +(i)]${i}[/@]</li>
              [#else] [#break/]
              [/#if]
              [/#list]
              [#if currentPageIndex<totalPageIndex]
              <li>[@b.a href="!examples?pageIndex=" +(currentPageIndex+1)]下一页[/@]</li>
              [/#if]
              <li>[@b.a href="!examples?pageIndex="+totalPageIndex]尾页[/@]</li>
            </ul>
          </div>
         
      </div>
    </div>
  </div>

</div> <!--end container-->
